package com.edison.controller;

import brave.Tracer;
import com.edison.democommon.api.ApiResponse;
import com.edison.democommon.api.Metadata;
import com.edison.service.AuthService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author edison
 */
@RestController
@Slf4j
@RequestMapping("/service-1")
public class DemoController {


    @Autowired
    private AuthService authService;
    @Resource
    private Tracer tracer;


    @GetMapping("/test/{type}")
    public ApiResponse<Object> getId()   {

       return ApiResponse.success(null,new Metadata(tracer.currentSpan().context().traceIdString(),String.valueOf(System.currentTimeMillis())));
    }



}
